package com.zn.opit.mongocomment.domain.entity;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;

/**
 * 资源评论
 */
@Data
@Document(collection = "resource_comment")
public class ResourceComment {

    @Id
    private String id;

    /**
     * 接收评论的资源ID或作品ID
     */
    @Indexed
    @Field(value = "resource_id")
    private Long resourceId;

    /**
     * 发表评论的用户ID
     */
    @Indexed
    @Field(value = "comment_user_id")
    private String commentUserId;

    /**
     * 发表评论的用户名
     */
    @Field(value = "comment_user_name")
    private String commentUserName;

    /**
     * 发表的评论内容
     */
    @Field(value = "comment_content")
    private String commentContent;

    /**
     * 发表评论的时间
     */
    private Date ctime;

    /**
     * 此条评论的状态:0为正常....
     */
    private String status;

    /**
     * 对此评论的回复
     */
    @Field(value = "comment_responses")
    private CommentResponse[] commentResponses;

}
